package com.bsj.power.common.def.dto.locationDevice;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bsj.power.common.constant.NumericalConstants;
import com.bsj.power.common.def.vo.pls.httpVo.HttpTagPosVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description 标签数据
 * @time 2024/5/21 15:40
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TagMsgDTO {

    /**
     * 标签id
     */
    private long id;

    /**
     * 标签名
     */
    private String name;

    /**
     * 推送消息类型 1标签状态消息 2标签位置消息
     */
    private int type;

    /**
     * 标签序列号（设备号）
     */
    private String sn;

    /**
     * 标签数据
     */
    private String data;

    /**
     * 数据接收时间
     */
    private long now;

    public TagMsgDTO(HttpTagPosVO httpTagPosVO) {
        this.type = NumericalConstants.TWO;
        this.sn = httpTagPosVO.getSn();
        this.name = httpTagPosVO.getName();
        this.data = JSONObject.toJSONString(httpTagPosVO);
    }

}
